#include "Date.h"

Date::Date()
{
   #include<"Date.h">
#include<string>
#include<iostream>
using namespace std;
Date::Date(){year=2015;month=1;day=1;}
Date::Date(char strDate[])
{
    char y[5];
    int i=0;
    while(strDate[i]!='\0'&&strDate[i]!=':')
    {y[i=strDate[i];i++;}
    y[i='\0'];
    year=atoi(y);
    if(strDate[i]!='\0')i++;
    char m[3];
    int j=i, k=0;
    while (strDate[i]!='\0'&&strDate[i]!=':')
    {m[i-j]=strDate[[i];i++;k++;}
    m[k]='\0';
    month=atoi(m);
    if (strDate[i]!='\0')i++;
    char d[3];
    j=1,k=0;
    while(strDate[i]!='\0'&&strDate[i]!=':')
    {d[i-j]=strDate[i];i++;k++;}
    d[k]='\0';
    day=atoi(d);

}
Date::Date(int Y,int M,int D):year(Y),month(M),day(D){}
void Date::setDate (int Y,int M,int D){year=y;month=M;day=D;}
void Date::show()const
{cout<<year<<"Äê(";
if (isLeapYear())
    cout <<"Èò";
else cout <<"Äê)"<<month<<"ÔÂ"<<day<<"ÈÕ";
cout <<endl;


}
int Date::getYear(){return year ;}
void Date::setYear(int Y){year=y;}
int Date::getMonth(){return month;}
void Date::serMonth(int M){month=M;}
int Date::getDay(){return day;}
void Date::setDay(int D){day=D;}
char*Date::toString()
{  char *arr=new char[20];
   char*IntToString(int);
   strcpy(arr,IntToString(year));
   strcat(arr,":");
   strcat(arr,IntToString(month));
   strcat(arr,":");
   strcat(arr,IntToString(day));
   return arr;

}
int Date::daysPerMonth(int m)const
{m=(m<0)?month: //ctor
}

Date::~Date()
{
    //dtor
}
